import { FormSchema } from '/@/components/Table';
import { render } from '/@/utils/common/renderUtils';
export const columns = [
  {
    title: '校验编码',
    dataIndex: 'attachmentCode',
    width: 150,
  },
  {
    title: '校验类型',
    dataIndex: 'attachmentType',
    width: 300,
  },
  {
    title: '校验结果',
    dataIndex: 'responseCheck',
    width: 200,
    sorter: true,
    customRender: ({ text }) => {
      return render.renderDict(text, 'responseCheck');
    },
  },
  {
    title: '附件名称',
    dataIndex: 'attachmentName',
    width: 300,
  },
  {
    title: '提示信息',
    dataIndex: 'responseData',
    width: 300,
  },
  {
    title: '错误提示信息',
    dataIndex: 'responseMessage',
    // width: 300,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'attachmentCode',
    label: '校验编码',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'attachmentType',
    label: '校验类型',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: '校验结果',
    field: 'responseCheck',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'responseCheck',
      placeholder: '请选择校验结果',
      stringToNumber: true,
    },
    colProps: { span: 6 },
  },
];
/**
 * 角色用户搜索form
 */
export const searchUserFormSchema: FormSchema[] = [
  {
    field: 'username',
    label: '用户账号',
    component: 'Input',
    colProps: { span: 12 },
    labelWidth: 74,
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'id',
    label: '',
    component: 'Input',
    show: false,
  },
  {
    field: 'attachmentType',
    label: '附件类型',
    required: true,
    component: 'Input',
  },
  {
    field: 'uploadFileMax',
    component: 'JUpload',
    helpMessage: '最多上传1个文件',
    label: '上传文件（1）',
    componentProps: { maxCount: 1 },
  },
];

export const formDescSchema = [
  {
    field: 'roleName',
    label: '角色名称',
  },
  {
    field: 'roleCode',
    label: '角色编码',
  },
  {
    label: '备注',
    field: 'description',
  },
];

export const modelFormSchema: FormSchema[] = [
  {
    label: 'APIkey',
    field: 'apiKey',
    component: 'Input',
    required: true,
    helpMessage: '请输入APIkey',
  },
];